package com.adams.config.engine;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 
 * 
 * File Name : PropertesEngine.java
 * 
 * @Description : <Detail Description for Class >
 * @author 903819 杜峰
 */
public class PropertesEngine
{

	private static Properties props;

	static
	{
		props = new Properties();
	}

	public static void load() throws IOException
	{
		InputStream is = PropertesEngine.class.getClassLoader()
				.getResourceAsStream("config.properties");
		props.load(is);
	}

	public static void load(String path) throws IOException
	{

		InputStream is = PropertesEngine.class.getClassLoader()
				.getResourceAsStream(path);
		props.load(is);
	}

	public static void load(InputStream is) throws IOException
	{
		props.load(is);
	}

	public static String getProperty(String key)
	{
		return props.getProperty(key);
	}

}
